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

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: A = None
        self.u: B = None
        self.txt = txt

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

k = A("k")
a = B("a")
g = C("g")
l = D("l")
i = E("i")
d = D("d")
f = E("f")

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: A = None
        self.u: B = None
        self.txt = txt

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

k = A("k")
a = B("a")
g = C("g")
l = D("l")
i = E("i")
d = D("d")
f = E("f")

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