class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: E = None
        self.u: E = None
        self.r: A = None
        self.z: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: C = None
        self.u: B = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.txt = txt

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

i = A("i")
k = B("k")
a = C("a")
b = D("b")
j = E("j")
d = F("d")
f = E("f")
n = C("n")
h = C("h")
e = A("e")

i.q = e
i.r = e
i.z = e
i.y = j
i.u = j
k.r = f
k.x = d
a.z = h
a.t = d
b.v = e
b.y = a
b.u = k
b.s = h
j.u = n
j.t = f
d.r = a
f.u = a
f.t = j
n.z = h
n.t = d
h.z = n
h.t = d
e.q = i
e.r = i
e.z = i
e.y = f
e.u = f
assert d.r.t.r.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: E = None
        self.u: E = None
        self.r: A = None
        self.z: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: C = None
        self.u: B = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.txt = txt

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

i = A("i")
k = B("k")
a = C("a")
b = D("b")
j = E("j")
d = F("d")
f = E("f")
n = C("n")
h = C("h")
e = A("e")

i.q = e
i.r = e
i.z = e
i.y = j
i.u = j
k.r = f
k.x = d
a.z = h
a.t = d
b.v = e
b.y = a
b.u = k
b.s = h
j.u = n
j.t = f
d.r = a
f.u = a
f.t = j
n.z = h
n.t = d
h.z = n
h.t = d
e.q = i
e.r = i
e.z = i
e.y = f
e.u = f
assert d.r.t.r.z.t.txt == "d"