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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: B = None
        self.s: A = None
        self.u: B = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: B = None
        self.s: A = None
        self.u: B = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

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