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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: A = None
        self.w: A = None
        self.txt = txt

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

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

f = A("f")
b = B("b")
n = C("n")
c = D("c")
a = E("a")
e = A("e")
d = C("d")
k = E("k")
i = B("i")

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: A = None
        self.w: A = None
        self.txt = txt

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

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

f = A("f")
b = B("b")
n = C("n")
c = D("c")
a = E("a")
e = A("e")
d = C("d")
k = E("k")
i = B("i")

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