class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: H = None
        self.o: H = None
        self.s: G = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: E = None
        self.t: D = None
        self.p: C = None
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: C = None
        self.s: H = None
        self.p: E = None
        self.r: D = None
        self.q: B = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: F = None
        self.p: E = None
        self.x: H = None
        self.u: C = None
        self.w: F = None
        self.txt = txt

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

d = A("d")
n = B("n")
e = C("e")
m = D("m")
b = E("b")
k = F("k")
c = G("c")
i = H("i")

d.w = m
d.q = i
d.o = i
d.s = c
d.z = e
n.q = c
n.x = b
n.t = m
n.w = m
n.p = e
e.x = n
e.v = n
m.z = c
m.x = e
b.y = i
k.t = n
k.q = n
k.y = e
k.s = i
k.p = b
k.v = b
k.r = m
c.q = m
c.y = k
c.w = k
c.p = b
c.x = i
c.u = e
i.o = e
i.q = m
assert i.q.x.x.x.y.o.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: H = None
        self.o: H = None
        self.s: G = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: E = None
        self.t: D = None
        self.p: C = None
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: C = None
        self.s: H = None
        self.p: E = None
        self.r: D = None
        self.q: B = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: F = None
        self.p: E = None
        self.x: H = None
        self.u: C = None
        self.w: F = None
        self.txt = txt

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

d = A("d")
n = B("n")
e = C("e")
m = D("m")
b = E("b")
k = F("k")
c = G("c")
i = H("i")

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