class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: D = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: F = None
        self.z: D = None
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.u: B = None
        self.v: F = None
        self.r: C = None
        self.o: F = None
        self.txt = txt

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

e = A("e")
l = B("l")
g = C("g")
d = D("d")
b = E("b")
h = F("h")
m = A("m")
n = F("n")
k = E("k")
j = D("j")

e.x = l
e.t = j
e.r = j
l.q = h
g.p = d
g.w = h
g.z = j
g.o = n
d.q = k
b.w = g
b.t = g
b.r = g
b.u = l
b.v = n
b.o = n
h.r = l
h.x = g
m.x = l
m.t = j
m.r = d
n.r = l
n.x = g
k.w = g
k.t = g
k.r = g
k.u = l
k.v = n
k.o = h
j.q = b
assert b.u.q.x.z.q.u.q.r.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: D = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: F = None
        self.z: D = None
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.u: B = None
        self.v: F = None
        self.r: C = None
        self.o: F = None
        self.txt = txt

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

e = A("e")
l = B("l")
g = C("g")
d = D("d")
b = E("b")
h = F("h")
m = A("m")
n = F("n")
k = E("k")
j = D("j")

e.x = l
e.t = j
e.r = j
l.q = h
g.p = d
g.w = h
g.z = j
g.o = n
d.q = k
b.w = g
b.t = g
b.r = g
b.u = l
b.v = n
b.o = n
h.r = l
h.x = g
m.x = l
m.t = j
m.r = d
n.r = l
n.x = g
k.w = g
k.t = g
k.r = g
k.u = l
k.v = n
k.o = h
j.q = b
assert b.u.q.x.z.q.u.q.r.q.x.txt == "g"