class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: B = None
        self.u: E = None
        self.q: E = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: D = None
        self.s: E = None
        self.r: E = None
        self.w: D = None
        self.txt = txt

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

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

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

l.r = c
l.s = f
l.u = j
l.q = j
l.x = e
k.o = j
k.z = c
k.s = l
e.x = h
e.p = h
e.s = j
e.r = j
e.w = m
h.x = k
j.u = e
j.p = m
j.q = l
j.w = l
f.o = j
f.z = k
f.s = l
c.o = j
c.z = k
c.s = l
m.x = f
b.o = j
b.z = k
b.s = l
assert f.o.q.u.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: B = None
        self.u: E = None
        self.q: E = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: D = None
        self.s: E = None
        self.r: E = None
        self.w: D = None
        self.txt = txt

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

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

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

l.r = c
l.s = f
l.u = j
l.q = j
l.x = e
k.o = j
k.z = c
k.s = l
e.x = h
e.p = h
e.s = j
e.r = j
e.w = m
h.x = k
j.u = e
j.p = m
j.q = l
j.w = l
f.o = j
f.z = k
f.s = l
c.o = j
c.z = k
c.s = l
m.x = f
b.o = j
b.z = k
b.s = l
assert f.o.q.u.q.x.txt == "e"