class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: D = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: E = None
        self.p: G = None
        self.z: G = None
        self.v: G = None
        self.q: D = None
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: B = None
        self.q: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: B = None
        self.q: B = None
        self.x: C = None
        self.s: C = None
        self.y: C = None
        self.v: E = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: F = None
        self.x: D = None
        self.y: G = None
        self.txt = txt

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

l.t = g
l.w = j
l.u = c
f.x = c
n.y = f
n.s = i
n.p = g
n.z = g
n.v = g
n.q = j
n.o = d
j.v = n
j.s = f
j.q = c
c.p = d
c.u = f
k.p = e
k.o = f
k.q = f
k.x = n
k.s = n
k.y = n
k.v = c
k.t = l
g.t = f
g.v = f
g.x = d
g.y = c
g.u = e
g.p = l
g.w = l
g.z = j
d.o = n
d.q = k
d.x = j
d.y = g
i.p = d
i.u = f
e.p = k
e.o = f
e.q = f
e.x = n
e.s = n
e.y = n
e.v = c
e.t = l
assert g.x.y.x.o.q.q.u.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: D = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: E = None
        self.p: G = None
        self.z: G = None
        self.v: G = None
        self.q: D = None
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: B = None
        self.q: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: B = None
        self.q: B = None
        self.x: C = None
        self.s: C = None
        self.y: C = None
        self.v: E = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: F = None
        self.x: D = None
        self.y: G = None
        self.txt = txt

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

l.t = g
l.w = j
l.u = c
f.x = c
n.y = f
n.s = i
n.p = g
n.z = g
n.v = g
n.q = j
n.o = d
j.v = n
j.s = f
j.q = c
c.p = d
c.u = f
k.p = e
k.o = f
k.q = f
k.x = n
k.s = n
k.y = n
k.v = c
k.t = l
g.t = f
g.v = f
g.x = d
g.y = c
g.u = e
g.p = l
g.w = l
g.z = j
d.o = n
d.q = k
d.x = j
d.y = g
i.p = d
i.u = f
e.p = k
e.o = f
e.q = f
e.x = n
e.s = n
e.y = n
e.v = c
e.t = l
assert g.x.y.x.o.q.q.u.x.p.txt == "d"