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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: E = None
        self.w: E = None
        self.z: E = None
        self.x: A = None
        self.y: G = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: F = None
        self.u: F = None
        self.t: G = None
        self.w: C = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: E = None
        self.w: E = None
        self.z: E = None
        self.x: A = None
        self.y: G = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: F = None
        self.u: F = None
        self.t: G = None
        self.w: C = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: C = None
        self.txt = txt

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

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

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

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