class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: C = None
        self.z: B = None
        self.o: F = None
        self.u: F = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: G = None
        self.s: F = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: C = None
        self.z: B = None
        self.o: F = None
        self.u: F = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: G = None
        self.s: F = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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