class LazySegmentTree
  def initialize(arr, l = 0, r = arr.size - 1)
    @l, @r = l, r
    @lazy = nil
    if l == r
      @agg = arr[l]
    else
      c = (l + r) / 2
      @left_child = self.class.new(arr, l, c)
      @right_child = self.class.new(arr, c + 1, r)
      @agg = aggregate(@left_child.agg, @right_child.agg)
    end
  end

  attr_reader :agg, :l, :r

  def update(l, r, x)
    if @l == @r
      @agg += x
    elsif l == @l && r == @r
      if @lazy
        @lazy += x
      else
        @lazy = x
      end
    else
      force
      @agg += x * (r - l + 1)
      if r <= @left_child.r
        @left_child.update(l, r, x)
      elsif @right_child.l <= l
        @left_child.update(l, r, x)
      else
        @left_child.update(l, @left_child.r, x)
        @right_child.update(@right_child.l, r, x)
      end
    end
  end

  attr_reader :lazy, :left_child, :right_child

  def force
    return if !@lazy
    x = @lazy
    @lazy = nil
    @agg += x * (@r - @l + 1)
    @left_child.update(@left_child.l, @left_child.r, x)
    @right_child.update(@right_child.l, @right_child.r, x)
  end

  def query(l, r)
    force
    return @agg if l == @l && r == @r
    if r <= @left_child.r
      return @left_child.query(l, r)
    elsif @right_child.l <= l
      return @right_child.query(l, r)
    else
      aggl = @left_child.query(l, @left_child.r)
      aggr = @right_child.query(@right_child.l, r)
      return aggregate(aggl, aggr)
    end
  end

  def aggregate(x, y)
    x + y
  end
end

n = gets.to_i
tree = Hash[(0..n-1).map {|i| [i, {}] }]
tree_inv = Hash[(0..n-1).map {|i| [i, nil] }]
out_degree = Hash[(0..n-1).map {|i| [i, 0] }]
n.times do |i|
  k, *neighbours = gets.split.map(&:to_i)
  neighbours.each do |j|
    tree[i][j] = 0
    out_degree[i] += 1
    tree_inv[j] = i
  end
end

subtree_size = Hash[(0..n-1).map {|i| [i, 1] }]
queue = []
out_degree.each do |i, k|
  if k == 0
    queue << i
  end
end
until queue.empty?
  i = queue.shift
  tree[i].each_key do |j|
    subtree_size[i] += subtree_size[j]
  end
  j = tree_inv[i]
  if j
    out_degree[j] -= 1
    queue << j if out_degree[j] == 0
  end
end

# Heavy-Light Decomposition
queue = [0]
position = {}
path_head = {}
until queue.empty?
  i = queue.shift
  path = [i]
  loop do
    heavy = true
    tree[i].each_key.sort_by {|j| -subtree_size[j]}.each do |j|
      if heavy
        path << j
        i = j
        heavy = false
      else
        queue << j
      end
    end
    break if heavy
  end
  path.unshift tree_inv[path[0]] if tree_inv[path[0]]
  weights = path.each_cons(2).map {|i, j| tree[i][j] }
  seg = LazySegmentTree.new(weights)
  (1..path.size - 1).each do |i|
    position[path[i]] = [seg, i - 1]
    path_head[path[i]] = path[0]
  end
end

q = gets.to_i
q.times do
  t, i, w = gets.split.map(&:to_i)
  if t == 1
    sum = 0
    loop do
      seg, j = position[i]
      break if !seg
      sum += seg.query(0, j)
      i = path_head[i]
    end
    p sum
  else
    loop do
      seg, j = position[i]
      break if !seg
      seg.update(0, j, w)
      i = path_head[i]
    end
  end
end

