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

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: B = None
        self.q: F = None
        self.o: C = None
        self.z: A = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: D = None
        self.u: D = None
        self.v: F = None
        self.x: F = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

d = A("d")
a = B("a")
n = C("n")
b = D("b")
f = E("f")
l = F("l")
g = D("g")
h = C("h")
k = B("k")

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

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: B = None
        self.q: F = None
        self.o: C = None
        self.z: A = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: D = None
        self.u: D = None
        self.v: F = None
        self.x: F = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

d = A("d")
a = B("a")
n = C("n")
b = D("b")
f = E("f")
l = F("l")
g = D("g")
h = C("h")
k = B("k")

d.t = k
d.y = a
a.t = k
a.r = k
a.q = l
a.o = h
a.z = d
a.x = f
n.z = k
n.q = k
n.y = g
n.u = g
n.v = l
n.x = l
b.q = g
b.x = d
b.y = n
b.z = h
f.p = d
l.r = g
g.q = b
g.x = d
g.y = n
g.z = n
h.z = k
h.y = b
h.u = g
h.v = l
h.x = l
h.q = a
k.t = a
k.r = a
k.q = l
k.o = n
k.z = d
k.x = f
assert f.p.t.t.r.z.txt == "d"