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

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

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

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

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

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

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

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

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

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

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

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

n.z = i
n.u = b
n.o = h
n.q = j
i.x = g
i.u = b
i.o = b
l.t = b
l.p = h
l.y = n
h.p = i
h.r = d
h.s = j
b.o = d
b.y = j
b.x = j
b.u = i
b.r = h
d.t = j
d.p = h
d.y = n
j.o = l
j.y = b
j.x = b
j.u = i
j.r = h
g.x = i
g.u = b
g.o = b
assert n.o.s.u.x.u.y.x.txt == "b"