class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: E = None
        self.w: C = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: H = None
        self.x: H = None
        self.z: A = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: H = None
        self.p: A = None
        self.t: F = None
        self.r: E = None
        self.w: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: A = None
        self.p: C = None
        self.u: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: E = None
        self.z: I = None
        self.q: F = None
        self.v: F = None
        self.o: I = None
        self.r: I = None
        self.u: G = None
        self.w: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: H = None
        self.x: H = None
        self.z: A = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: H = None
        self.p: A = None
        self.t: F = None
        self.r: E = None
        self.w: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: A = None
        self.p: C = None
        self.u: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: E = None
        self.z: I = None
        self.q: F = None
        self.v: F = None
        self.o: I = None
        self.r: I = None
        self.u: G = None
        self.w: D = None
        self.txt = txt

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

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

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