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

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

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

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

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

m = A("m")
j = B("j")
h = C("h")
a = D("a")
i = E("i")
l = D("l")
g = B("g")
n = A("n")
f = E("f")

m.r = j
m.y = a
m.z = g
m.u = g
j.o = i
j.q = i
j.s = g
h.q = n
h.z = a
h.p = f
a.p = l
i.y = m
l.p = a
g.o = f
g.q = f
g.s = j
n.r = j
n.z = j
n.y = a
n.u = g
f.y = m
assert i.y.r.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: D = None
        self.z: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

m = A("m")
j = B("j")
h = C("h")
a = D("a")
i = E("i")
l = D("l")
g = B("g")
n = A("n")
f = E("f")

m.r = j
m.y = a
m.z = g
m.u = g
j.o = i
j.q = i
j.s = g
h.q = n
h.z = a
h.p = f
a.p = l
i.y = m
l.p = a
g.o = f
g.q = f
g.s = j
n.r = j
n.z = j
n.y = a
n.u = g
f.y = m
assert i.y.r.s.s.txt == "j"