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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: H = None
        self.t: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: C = None
        self.q: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: H = None
        self.t: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: C = None
        self.q: B = None
        self.txt = txt

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

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