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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: D = None
        self.t: C = None
        self.x: E = None
        self.u: D = None
        self.txt = txt

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

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

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

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

h.y = j
h.u = c
h.w = c
h.r = k
h.o = k
j.s = e
j.x = e
j.y = k
j.u = k
j.t = c
c.y = k
c.t = e
c.s = j
k.v = e
e.w = j
l.y = j
l.u = c
l.w = c
l.r = k
l.o = k
assert j.u.v.w.y.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: C = None
        self.r: D = None
        self.w: C = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: D = None
        self.t: C = None
        self.x: E = None
        self.u: D = None
        self.txt = txt

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

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

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

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

h.y = j
h.u = c
h.w = c
h.r = k
h.o = k
j.s = e
j.x = e
j.y = k
j.u = k
j.t = c
c.y = k
c.t = e
c.s = j
k.v = e
e.w = j
l.y = j
l.u = c
l.w = c
l.r = k
l.o = k
assert j.u.v.w.y.v.w.txt == "j"