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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: A = None
        self.w: H = None
        self.o: E = None
        self.p: A = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: A = None
        self.w: H = None
        self.o: E = None
        self.p: A = None
        self.t: C = None
        self.txt = txt

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

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

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