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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: F = None
        self.z: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: A = None
        self.x: E = None
        self.v: F = None
        self.w: C = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: G = None
        self.y: F = None
        self.v: A = None
        self.u: D = None
        self.z: D = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: F = None
        self.z: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: A = None
        self.x: E = None
        self.v: F = None
        self.w: C = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: G = None
        self.y: F = None
        self.v: A = None
        self.u: D = None
        self.z: D = None
        self.s: D = None
        self.txt = txt

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

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