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

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

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

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

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

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

i.u = e
i.y = d
d.v = i
d.x = h
d.o = e
c.s = f
c.u = n
l.s = g
l.p = n
l.z = i
h.y = f
h.w = i
h.q = i
h.z = g
h.t = l
e.y = n
e.t = n
e.w = i
e.q = i
e.z = d
f.s = d
f.p = l
f.z = i
g.v = i
g.x = h
g.o = e
n.s = d
n.p = l
n.z = i
assert n.s.x.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

i.u = e
i.y = d
d.v = i
d.x = h
d.o = e
c.s = f
c.u = n
l.s = g
l.p = n
l.z = i
h.y = f
h.w = i
h.q = i
h.z = g
h.t = l
e.y = n
e.t = n
e.w = i
e.q = i
e.z = d
f.s = d
f.p = l
f.z = i
g.v = i
g.x = h
g.o = e
n.s = d
n.p = l
n.z = i
assert n.s.x.w.y.txt == "d"