class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: A = None
        self.u: A = None
        self.p: D = None
        self.t: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

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

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

l = A("l")
g = B("g")
k = C("k")
d = D("d")
b = E("b")
a = A("a")
n = E("n")

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

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

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

l = A("l")
g = B("g")
k = C("k")
d = D("d")
b = E("b")
a = A("a")
n = E("n")

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