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

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

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

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

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

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

i.t = e
i.s = e
i.q = g
i.u = a
i.p = a
j.y = i
j.p = e
j.r = a
g.v = e
e.x = a
e.v = a
e.y = i
e.p = g
a.q = i
a.v = g
a.r = g
a.x = j
a.t = e
assert j.y.u.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: C = None
        self.s: D = None
        self.u: E = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

i.t = e
i.s = e
i.q = g
i.u = a
i.p = a
j.y = i
j.p = e
j.r = a
g.v = e
e.x = a
e.v = a
e.y = i
e.p = g
a.q = i
a.v = g
a.r = g
a.x = j
a.t = e
assert j.y.u.t.x.txt == "a"