class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: B = None
        self.v: B = None
        self.z: A = None
        self.t: E = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: B = None
        self.v: B = None
        self.z: A = None
        self.t: E = None
        self.p: B = None
        self.txt = txt

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

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