class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: A = None
        self.t: A = None
        self.x: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

e.o = n
e.x = n
e.q = h
e.t = h
e.v = b
g.x = h
g.v = h
g.q = m
i.q = b
b.p = n
b.z = n
b.r = n
b.w = e
j.t = e
j.x = m
j.o = b
j.w = d
h.o = n
h.x = n
h.v = n
h.q = e
h.t = e
n.p = b
n.z = b
n.r = b
n.w = h
d.t = h
d.x = m
d.o = n
d.w = j
m.x = e
m.v = h
m.q = g
assert i.q.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: A = None
        self.t: A = None
        self.x: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

e.o = n
e.x = n
e.q = h
e.t = h
e.v = b
g.x = h
g.v = h
g.q = m
i.q = b
b.p = n
b.z = n
b.r = n
b.w = e
j.t = e
j.x = m
j.o = b
j.w = d
h.o = n
h.x = n
h.v = n
h.q = e
h.t = e
n.p = b
n.z = b
n.r = b
n.w = h
d.t = h
d.x = m
d.o = n
d.w = j
m.x = e
m.v = h
m.q = g
assert i.q.r.w.txt == "h"