class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: C = None
        self.v: C = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: E = None
        self.v: C = None
        self.s: A = None
        self.u: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

k = A("k")
j = B("j")
l = C("l")
h = D("h")
f = E("f")
e = B("e")
a = C("a")

k.u = h
k.t = l
k.v = a
k.w = f
j.x = e
j.w = f
j.v = a
j.s = k
j.u = k
l.w = e
l.y = j
l.x = j
l.p = f
l.s = a
h.u = l
f.t = j
e.x = j
e.w = f
e.v = a
e.s = k
e.u = k
a.w = e
a.y = e
a.x = e
a.p = f
a.s = l
assert j.u.u.u.p.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: C = None
        self.v: C = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: E = None
        self.v: C = None
        self.s: A = None
        self.u: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

k = A("k")
j = B("j")
l = C("l")
h = D("h")
f = E("f")
e = B("e")
a = C("a")

k.u = h
k.t = l
k.v = a
k.w = f
j.x = e
j.w = f
j.v = a
j.s = k
j.u = k
l.w = e
l.y = j
l.x = j
l.p = f
l.s = a
h.u = l
f.t = j
e.x = j
e.w = f
e.v = a
e.s = k
e.u = k
a.w = e
a.y = e
a.x = e
a.p = f
a.s = l
assert j.u.u.u.p.t.x.txt == "e"