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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: F = None
        self.q: A = None
        self.t: D = None
        self.txt = txt

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

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

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

e = A("e")
c = B("c")
h = C("h")
n = D("n")
g = E("g")
k = F("k")
b = D("b")
l = D("l")
j = A("j")

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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: F = None
        self.q: A = None
        self.t: D = None
        self.txt = txt

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

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

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

e = A("e")
c = B("c")
h = C("h")
n = D("n")
g = E("g")
k = F("k")
b = D("b")
l = D("l")
j = A("j")

e.u = j
c.x = l
c.p = k
c.y = h
c.v = n
c.z = j
c.o = j
h.x = n
h.v = k
h.q = j
h.t = l
n.w = c
g.z = h
k.o = n
k.t = g
b.w = c
l.w = c
j.u = e
assert j.u.u.u.u.u.txt == "e"