class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: B = None
        self.o: E = None
        self.r: C = None
        self.x: G = None
        self.p: G = None
        self.v: F = None
        self.z: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: E = None
        self.txt = txt

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

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

i.q = h
i.o = h
i.u = n
i.r = m
i.x = c
i.p = c
i.z = c
i.v = b
n.r = m
n.u = f
n.o = f
n.x = a
n.q = a
n.w = d
n.y = b
m.t = c
d.v = h
d.p = a
h.w = c
h.u = d
b.s = n
b.r = c
b.o = c
b.v = h
b.t = m
b.y = d
c.o = i
c.t = h
a.z = h
f.r = m
f.u = n
f.o = n
f.x = a
f.q = a
f.w = d
f.y = b
assert a.z.w.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: B = None
        self.o: E = None
        self.r: C = None
        self.x: G = None
        self.p: G = None
        self.v: F = None
        self.z: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: E = None
        self.txt = txt

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

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

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