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

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

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

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

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

i = A("i")
k = B("k")
l = C("l")
n = D("n")
m = E("m")
e = D("e")
f = C("f")
c = D("c")

i.r = k
i.y = m
k.o = i
k.v = l
k.s = m
k.t = m
l.w = k
l.t = m
l.y = i
l.q = f
n.q = i
n.z = k
n.s = m
m.w = f
e.q = i
e.z = k
e.s = m
f.w = k
f.t = m
f.y = i
f.q = l
c.q = i
c.z = k
c.s = m
assert f.y.r.s.w.t.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: E = None
        self.txt = txt

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

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

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

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

i = A("i")
k = B("k")
l = C("l")
n = D("n")
m = E("m")
e = D("e")
f = C("f")
c = D("c")

i.r = k
i.y = m
k.o = i
k.v = l
k.s = m
k.t = m
l.w = k
l.t = m
l.y = i
l.q = f
n.q = i
n.z = k
n.s = m
m.w = f
e.q = i
e.z = k
e.s = m
f.w = k
f.t = m
f.y = i
f.q = l
c.q = i
c.z = k
c.s = m
assert f.y.r.s.w.t.w.q.txt == "l"