class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: C = None
        self.v: B = None
        self.w: C = None
        self.y: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: E = None
        self.x: C = None
        self.o: A = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: D = None
        self.v: C = None
        self.s: B = None
        self.y: A = None
        self.txt = txt

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

k.p = h
k.u = j
k.w = j
k.v = c
k.y = e
c.o = m
c.q = b
c.w = k
c.v = g
j.x = h
e.y = b
e.v = g
e.x = j
e.o = i
e.w = k
l.o = j
l.v = j
l.t = e
l.s = h
l.y = i
m.o = c
m.q = b
m.w = i
m.v = l
i.p = m
i.v = m
i.u = j
i.w = j
i.y = b
g.o = j
g.v = j
g.t = e
g.s = c
g.y = i
b.y = e
b.v = g
b.x = j
b.o = i
b.w = i
h.o = c
h.q = b
h.w = i
h.v = g
assert k.w.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: C = None
        self.v: B = None
        self.w: C = None
        self.y: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: E = None
        self.x: C = None
        self.o: A = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: D = None
        self.v: C = None
        self.s: B = None
        self.y: A = None
        self.txt = txt

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

k.p = h
k.u = j
k.w = j
k.v = c
k.y = e
c.o = m
c.q = b
c.w = k
c.v = g
j.x = h
e.y = b
e.v = g
e.x = j
e.o = i
e.w = k
l.o = j
l.v = j
l.t = e
l.s = h
l.y = i
m.o = c
m.q = b
m.w = i
m.v = l
i.p = m
i.v = m
i.u = j
i.w = j
i.y = b
g.o = j
g.v = j
g.t = e
g.s = c
g.y = i
b.y = e
b.v = g
b.x = j
b.o = i
b.w = i
h.o = c
h.q = b
h.w = i
h.v = g
assert k.w.x.w.txt == "i"