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

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: B = None
        self.p: D = None
        self.txt = txt

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

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

a.s = k
d.q = e
d.w = l
d.r = j
d.s = k
d.t = k
l.z = e
b.z = j
b.o = m
b.p = g
j.w = n
j.r = d
j.t = g
k.s = n
g.z = j
g.o = d
g.p = b
n.s = a
m.q = e
m.w = e
m.r = j
m.s = n
m.t = k
e.z = l
assert a.s.s.s.s.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: B = None
        self.p: D = None
        self.txt = txt

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

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

a.s = k
d.q = e
d.w = l
d.r = j
d.s = k
d.t = k
l.z = e
b.z = j
b.o = m
b.p = g
j.w = n
j.r = d
j.t = g
k.s = n
g.z = j
g.o = d
g.p = b
n.s = a
m.q = e
m.w = e
m.r = j
m.s = n
m.t = k
e.z = l
assert a.s.s.s.s.s.s.s.txt == "k"