class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: A = None
        self.v: B = None
        self.t: E = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

m.p = k
m.t = k
m.q = g
m.z = g
m.v = d
d.o = g
d.t = m
d.z = l
l.s = d
l.v = d
l.r = d
l.o = m
l.u = j
j.v = m
j.t = d
j.y = d
j.u = k
j.p = l
k.z = g
k.x = d
k.t = j
g.p = k
g.t = k
g.q = m
g.z = m
g.v = d
assert l.r.z.o.v.t.txt == "m"