#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10;
char str[MAXN], ch[MAXN << 1];
int pre[MAXN << 1];
int len;
int find(int x) {
  if (pre[x] == x) return x;
  return pre[x] = find(pre[x]);
}
inline void merge(int x, int y) {
  int fx = find(x);
  int fy = find(y);
  if (fx > fy)
    pre[fy] = fx;
  else
    pre[fx] = fy;
}
inline void solve(int k) {
  for (int i = k; i < len + k; ++i) {
    i = find(i);
    if (i < len + k) {
      ch[i] = str[i - k];
      merge(i, i + 1);
    }
  }
}
int main() {
  memset(ch, 0, sizeof(ch));
  for (int i = 0; i < MAXN << 1; ++i) {
    pre[i] = i;
  }
  int n, m, k, maxn = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    getchar();
    scanf("%s %d", str, &m);
    len = strlen(str);
    for (int j = 1; j <= m; ++j) {
      scanf(" %d", &k);
      maxn = max(maxn, k + len - 1);
      solve(k);
    }
  }
  for (int i = 1; i <= maxn; ++i) {
    if (!ch[i])
      printf("a");
    else
      printf("%c", ch[i]);
  }
  puts("");
  return 0;
}
