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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: A = None
        self.s: D = None
        self.y: C = None
        self.q: A = None
        self.txt = txt

j = A("j")
n = B("n")
d = C("d")
a = D("a")
i = E("i")
c = E("c")
e = C("e")
m = A("m")

j.t = d
j.w = a
n.s = a
n.q = a
d.q = i
d.r = i
d.t = n
d.w = n
d.v = a
a.t = c
i.r = a
i.s = a
i.o = j
i.y = e
i.q = m
c.r = a
c.s = a
c.o = m
c.y = d
c.q = j
e.q = i
e.r = i
e.t = n
e.w = n
e.v = a
m.t = d
m.w = a
assert i.q.t.t.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: A = None
        self.s: D = None
        self.y: C = None
        self.q: A = None
        self.txt = txt

j = A("j")
n = B("n")
d = C("d")
a = D("a")
i = E("i")
c = E("c")
e = C("e")
m = A("m")

j.t = d
j.w = a
n.s = a
n.q = a
d.q = i
d.r = i
d.t = n
d.w = n
d.v = a
a.t = c
i.r = a
i.s = a
i.o = j
i.y = e
i.q = m
c.r = a
c.s = a
c.o = m
c.y = d
c.q = j
e.q = i
e.r = i
e.t = n
e.w = n
e.v = a
m.t = d
m.w = a
assert i.q.t.t.q.t.txt == "c"