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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: C = None
        self.txt = txt

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

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

m.x = n
m.q = n
m.u = k
m.w = c
h.v = k
h.x = c
h.r = l
d.t = n
d.p = h
d.s = l
d.v = c
d.o = m
n.y = e
n.w = e
c.p = d
c.w = n
k.v = h
k.r = h
k.x = c
e.t = n
e.p = l
e.s = l
e.v = c
e.o = b
l.v = h
l.r = h
l.x = c
b.x = n
b.q = n
b.u = l
b.w = c
f.t = n
f.p = h
f.s = k
f.v = c
f.o = b
assert f.o.q.w.txt == "e"