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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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

b.o = a
b.z = h
b.q = d
b.r = d
b.v = i
b.p = c
c.p = a
i.o = h
i.y = j
i.r = f
l.v = n
h.r = l
h.q = i
h.t = c
h.y = c
h.x = d
a.x = i
a.p = c
a.t = c
a.z = b
d.o = h
d.y = j
d.r = f
j.o = a
j.z = f
j.q = d
j.r = d
j.v = i
j.p = c
n.v = l
f.r = n
f.q = i
f.x = i
f.t = c
f.y = c
assert l.v.v.v.v.v.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: E = None
        self.q: C = None
        self.v: C = None
        self.r: C = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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

b.o = a
b.z = h
b.q = d
b.r = d
b.v = i
b.p = c
c.p = a
i.o = h
i.y = j
i.r = f
l.v = n
h.r = l
h.q = i
h.t = c
h.y = c
h.x = d
a.x = i
a.p = c
a.t = c
a.z = b
d.o = h
d.y = j
d.r = f
j.o = a
j.z = f
j.q = d
j.r = d
j.v = i
j.p = c
n.v = l
f.r = n
f.q = i
f.x = i
f.t = c
f.y = c
assert l.v.v.v.v.v.v.v.v.v.txt == "n"