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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: D = None
        self.t: D = None
        self.y: C = None
        self.o: B = None
        self.txt = txt

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

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

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

j = A("j")
m = B("m")
e = C("e")
l = D("l")
d = E("d")
n = B("n")
k = C("k")

j.q = l
j.r = d
j.v = n
j.w = e
m.p = l
m.v = l
m.t = l
m.y = k
m.o = n
e.t = m
e.u = k
l.x = k
d.y = e
d.v = j
n.p = l
n.v = l
n.t = l
n.y = k
n.o = m
k.t = m
k.u = e
assert k.u.u.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: E = None
        self.v: B = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: D = None
        self.t: D = None
        self.y: C = None
        self.o: B = None
        self.txt = txt

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

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

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

j = A("j")
m = B("m")
e = C("e")
l = D("l")
d = E("d")
n = B("n")
k = C("k")

j.q = l
j.r = d
j.v = n
j.w = e
m.p = l
m.v = l
m.t = l
m.y = k
m.o = n
e.t = m
e.u = k
l.x = k
d.y = e
d.v = j
n.p = l
n.v = l
n.t = l
n.y = k
n.o = m
k.t = m
k.u = e
assert k.u.u.t.y.txt == "k"