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

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

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

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

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

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

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

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

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

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

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

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

c.q = f
c.t = l
c.o = j
f.v = c
f.r = j
m.s = f
m.y = a
k.t = a
k.s = c
k.y = c
k.p = f
a.q = c
a.z = c
a.x = k
a.w = f
h.s = f
h.y = i
j.q = c
j.z = c
j.x = k
j.w = f
l.s = f
l.y = j
i.q = c
i.z = c
i.x = k
i.w = f
assert c.o.x.s.o.q.t.y.z.txt == "c"