class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: B = None
        self.z: A = None
        self.y: B = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: E = None
        self.z: E = None
        self.s: E = None
        self.txt = txt

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

c.o = k
c.p = l
m.w = i
m.s = f
k.y = i
f.p = c
f.z = c
f.v = i
f.y = i
f.q = m
e.r = c
e.v = a
e.z = d
e.s = d
i.w = m
i.s = f
d.r = l
d.v = a
d.z = e
d.s = e
l.o = k
l.p = c
a.r = l
a.v = d
a.z = e
a.s = e
assert c.o.y.w.w.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: B = None
        self.z: A = None
        self.y: B = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: E = None
        self.z: E = None
        self.s: E = None
        self.txt = txt

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

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