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

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

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

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

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

l = A("l")
i = B("i")
f = C("f")
c = D("c")
b = E("b")
j = C("j")

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

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

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

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

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

l = A("l")
i = B("i")
f = C("f")
c = D("c")
b = E("b")
j = C("j")

l.q = i
i.s = c
i.w = j
f.y = c
f.r = c
f.s = b
f.w = i
c.o = j
c.v = i
c.t = i
c.y = b
b.x = f
b.y = f
b.z = l
b.t = i
b.q = c
j.y = c
j.r = c
j.s = b
j.w = i
assert c.o.s.z.q.s.t.txt == "i"