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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: C = None
        self.w: G = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: F = None
        self.r: D = None
        self.v: F = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: B = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: F = None
        self.p: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: D = None
        self.u: B = None
        self.p: C = None
        self.txt = txt

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

l = A("l")
e = B("e")
f = C("f")
c = D("c")
a = E("a")
n = F("n")
d = G("d")
b = H("b")

l.t = d
e.u = l
e.q = l
e.p = f
e.w = d
f.s = d
f.u = n
f.v = n
f.r = c
f.t = c
c.x = l
c.o = e
c.p = f
a.q = l
a.p = l
a.u = n
n.p = f
n.s = f
n.q = c
n.y = d
n.o = l
n.r = l
d.z = f
d.p = f
d.w = c
d.u = e
b.y = n
b.u = a
b.q = e
assert n.q.p.s.u.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: C = None
        self.w: G = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: F = None
        self.r: D = None
        self.v: F = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: B = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: F = None
        self.p: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: D = None
        self.u: B = None
        self.p: C = None
        self.txt = txt

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

l = A("l")
e = B("e")
f = C("f")
c = D("c")
a = E("a")
n = F("n")
d = G("d")
b = H("b")

l.t = d
e.u = l
e.q = l
e.p = f
e.w = d
f.s = d
f.u = n
f.v = n
f.r = c
f.t = c
c.x = l
c.o = e
c.p = f
a.q = l
a.p = l
a.u = n
n.p = f
n.s = f
n.q = c
n.y = d
n.o = l
n.r = l
d.z = f
d.p = f
d.w = c
d.u = e
b.y = n
b.u = a
b.q = e
assert n.q.p.s.u.p.s.txt == "d"