class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: H = None
        self.p: C = None
        self.r: A = None
        self.t: G = None
        self.z: A = None
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: H = None
        self.z: F = None
        self.u: B = None
        self.o: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: H = None
        self.p: C = None
        self.r: A = None
        self.t: G = None
        self.z: A = None
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: H = None
        self.z: F = None
        self.u: B = None
        self.o: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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