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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: E = None
        self.p: B = None
        self.y: B = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: E = None
        self.p: B = None
        self.y: B = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: C = None
        self.txt = txt

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

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

k.r = a
k.q = a
k.x = a
k.s = f
k.u = b
e.s = m
e.x = d
e.p = f
e.y = f
e.u = b
l.x = f
l.u = d
l.t = c
b.u = l
b.t = l
m.w = b
m.s = b
m.x = c
m.v = k
c.x = e
c.u = m
c.t = l
f.s = m
f.x = d
f.p = e
f.y = e
f.u = b
d.w = b
d.s = b
d.x = l
d.v = k
a.r = k
a.q = k
a.x = k
a.s = e
a.u = b
assert b.t.t.x.s.txt == "m"