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

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

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

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

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

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

j.q = m
j.s = a
l.p = h
l.u = h
l.v = j
l.x = k
k.u = a
k.v = a
k.z = a
k.x = m
k.t = m
h.s = l
a.u = j
a.x = j
a.v = k
a.r = m
m.s = l
e.u = j
e.x = j
e.v = k
e.r = m
assert j.q.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

j.q = m
j.s = a
l.p = h
l.u = h
l.v = j
l.x = k
k.u = a
k.v = a
k.z = a
k.x = m
k.t = m
h.s = l
a.u = j
a.x = j
a.v = k
a.r = m
m.s = l
e.u = j
e.x = j
e.v = k
e.r = m
assert j.q.s.p.txt == "h"