class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: H = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: D = None
        self.t: A = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: A = None
        self.u: B = None
        self.y: B = None
        self.x: G = None
        self.r: F = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: G = None
        self.u: D = None
        self.o: B = None
        self.r: A = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: F = None
        self.s: B = None
        self.q: B = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: H = None
        self.w: H = None
        self.o: H = None
        self.p: E = None
        self.txt = txt

i = A("i")
e = B("e")
m = C("m")
k = D("k")
d = E("d")
c = F("c")
n = G("n")
a = H("a")
f = D("f")
g = H("g")

i.p = a
i.r = g
e.r = g
e.x = d
m.p = k
m.t = g
m.s = e
k.v = a
k.y = f
k.t = i
k.r = i
d.p = m
d.w = m
d.v = i
d.u = e
d.y = e
d.x = n
d.r = c
c.y = m
c.p = n
c.u = f
c.o = e
c.r = i
c.q = i
n.o = c
n.p = c
n.s = e
n.q = e
n.v = a
a.v = i
a.s = g
a.w = g
a.o = g
a.p = d
f.v = a
f.y = k
f.t = i
f.r = i
g.v = i
g.s = a
g.w = a
g.o = a
g.p = d
assert f.r.p.o.p.u.x.x.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: H = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: D = None
        self.t: A = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: A = None
        self.u: B = None
        self.y: B = None
        self.x: G = None
        self.r: F = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: G = None
        self.u: D = None
        self.o: B = None
        self.r: A = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: F = None
        self.s: B = None
        self.q: B = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: H = None
        self.w: H = None
        self.o: H = None
        self.p: E = None
        self.txt = txt

i = A("i")
e = B("e")
m = C("m")
k = D("k")
d = E("d")
c = F("c")
n = G("n")
a = H("a")
f = D("f")
g = H("g")

i.p = a
i.r = g
e.r = g
e.x = d
m.p = k
m.t = g
m.s = e
k.v = a
k.y = f
k.t = i
k.r = i
d.p = m
d.w = m
d.v = i
d.u = e
d.y = e
d.x = n
d.r = c
c.y = m
c.p = n
c.u = f
c.o = e
c.r = i
c.q = i
n.o = c
n.p = c
n.s = e
n.q = e
n.v = a
a.v = i
a.s = g
a.w = g
a.o = g
a.p = d
f.v = a
f.y = k
f.t = i
f.r = i
g.v = i
g.s = a
g.w = a
g.o = a
g.p = d
assert f.r.p.o.p.u.x.x.v.v.txt == "i"