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

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

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

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

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

e = A("e")
d = B("d")
f = C("f")
i = D("i")
j = E("j")
h = A("h")
b = B("b")
l = C("l")
n = D("n")

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

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

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

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

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

e = A("e")
d = B("d")
f = C("f")
i = D("i")
j = E("j")
h = A("h")
b = B("b")
l = C("l")
n = D("n")

e.r = i
e.u = l
e.p = d
e.o = f
e.x = b
d.o = e
d.w = h
d.z = j
d.p = j
d.q = n
f.x = j
f.z = e
i.z = d
i.s = j
i.q = f
j.u = h
j.x = i
j.w = i
h.r = n
h.u = l
h.o = l
h.p = d
h.x = b
b.o = e
b.w = e
b.z = j
b.p = j
b.q = i
l.x = j
l.z = e
n.z = b
n.s = j
n.q = f
assert j.x.q.z.r.s.u.p.q.q.txt == "f"