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

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

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

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

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

c = A("c")
d = B("d")
n = C("n")
b = D("b")
j = E("j")

c.q = n
c.x = j
c.t = j
c.r = j
c.u = b
d.r = b
d.t = b
d.y = c
n.q = d
n.x = b
b.s = d
b.p = d
j.r = d
j.o = b
j.w = b
j.q = n
j.s = c
assert j.s.q.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: E = None
        self.t: E = None
        self.u: D = None
        self.r: E = None
        self.txt = txt

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

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

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

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

c = A("c")
d = B("d")
n = C("n")
b = D("b")
j = E("j")

c.q = n
c.x = j
c.t = j
c.r = j
c.u = b
d.r = b
d.t = b
d.y = c
n.q = d
n.x = b
b.s = d
b.p = d
j.r = d
j.o = b
j.w = b
j.q = n
j.s = c
assert j.s.q.q.y.txt == "c"