class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: D = None
        self.y: G = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: D = None
        self.t: D = None
        self.v: A = None
        self.r: H = None
        self.txt = txt

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

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

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

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

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

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

a = A("a")
b = B("b")
n = C("n")
k = D("k")
m = E("m")
j = F("j")
h = G("h")
c = H("c")

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: D = None
        self.t: D = None
        self.v: A = None
        self.r: H = None
        self.txt = txt

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

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

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

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

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

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

a = A("a")
b = B("b")
n = C("n")
k = D("k")
m = E("m")
j = F("j")
h = G("h")
c = H("c")

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