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

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

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

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

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

i = A("i")
g = B("g")
b = C("b")
n = D("n")
e = E("e")
j = A("j")

i.r = g
i.s = n
i.u = b
i.p = b
i.q = j
g.w = e
g.z = e
g.t = b
g.q = b
g.s = n
b.w = i
n.t = b
e.v = i
e.y = b
e.o = b
e.w = g
j.r = g
j.s = n
j.u = b
j.p = b
j.q = i
assert e.y.w.q.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: D = None
        self.u: C = None
        self.q: A = None
        self.p: C = None
        self.txt = txt

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

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

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

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

i = A("i")
g = B("g")
b = C("b")
n = D("n")
e = E("e")
j = A("j")

i.r = g
i.s = n
i.u = b
i.p = b
i.q = j
g.w = e
g.z = e
g.t = b
g.q = b
g.s = n
b.w = i
n.t = b
e.v = i
e.y = b
e.o = b
e.w = g
j.r = g
j.s = n
j.u = b
j.p = b
j.q = i
assert e.y.w.q.u.w.txt == "i"