class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: E = None
        self.o: B = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: F = None
        self.u: B = None
        self.o: F = None
        self.r: A = None
        self.z: F = None
        self.txt = txt

n = A("n")
f = B("f")
k = C("k")
d = D("d")
j = E("j")
b = F("b")
i = G("i")
h = H("h")

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: F = None
        self.u: B = None
        self.o: F = None
        self.r: A = None
        self.z: F = None
        self.txt = txt

n = A("n")
f = B("f")
k = C("k")
d = D("d")
j = E("j")
b = F("b")
i = G("i")
h = H("h")

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