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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: C = None
        self.w: B = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: B = None
        self.u: E = None
        self.y: C = None
        self.t: F = None
        self.p: A = None
        self.txt = txt

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

e = A("e")
f = B("f")
l = C("l")
n = D("n")
a = E("a")
j = F("j")
c = C("c")
h = E("h")

e.u = a
e.z = n
f.t = c
l.r = c
n.s = f
n.w = f
n.t = c
n.v = l
a.r = h
a.u = h
a.q = f
a.y = l
a.t = j
a.p = e
j.r = n
c.r = l
h.r = a
h.u = a
h.q = f
h.y = c
h.t = j
h.p = e
assert c.r.r.r.r.r.r.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: C = None
        self.w: B = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: B = None
        self.u: E = None
        self.y: C = None
        self.t: F = None
        self.p: A = None
        self.txt = txt

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

e = A("e")
f = B("f")
l = C("l")
n = D("n")
a = E("a")
j = F("j")
c = C("c")
h = E("h")

e.u = a
e.z = n
f.t = c
l.r = c
n.s = f
n.w = f
n.t = c
n.v = l
a.r = h
a.u = h
a.q = f
a.y = l
a.t = j
a.p = e
j.r = n
c.r = l
h.r = a
h.u = a
h.q = f
h.y = c
h.t = j
h.p = e
assert c.r.r.r.r.r.r.r.r.txt == "c"