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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: F = None
        self.q: C = None
        self.s: C = None
        self.o: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: B = None
        self.s: A = None
        self.r: B = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: F = None
        self.q: C = None
        self.s: C = None
        self.o: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: B = None
        self.s: A = None
        self.r: B = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

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

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