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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: D = None
        self.p: A = None
        self.x: C = None
        self.txt = txt

l = A("l")
h = B("h")
a = C("a")
j = D("j")
i = E("i")
b = E("b")

l.q = h
h.q = l
h.x = l
a.r = i
a.y = b
a.s = h
a.o = h
a.u = j
j.w = a
j.q = l
j.r = l
j.s = l
i.y = b
i.v = j
i.p = l
i.x = a
b.y = i
b.v = j
b.p = l
b.x = a
assert i.v.r.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: D = None
        self.p: A = None
        self.x: C = None
        self.txt = txt

l = A("l")
h = B("h")
a = C("a")
j = D("j")
i = E("i")
b = E("b")

l.q = h
h.q = l
h.x = l
a.r = i
a.y = b
a.s = h
a.o = h
a.u = j
j.w = a
j.q = l
j.r = l
j.s = l
i.y = b
i.v = j
i.p = l
i.x = a
b.y = i
b.v = j
b.p = l
b.x = a
assert i.v.r.q.q.q.txt == "h"