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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: D = None
        self.r: H = None
        self.y: H = None
        self.z: H = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: B = None
        self.q: B = None
        self.z: H = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: H = None
        self.x: C = None
        self.t: F = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: D = None
        self.r: H = None
        self.y: H = None
        self.z: H = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: B = None
        self.q: B = None
        self.z: H = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: H = None
        self.x: C = None
        self.t: F = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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