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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: G = None
        self.q: C = None
        self.p: D = None
        self.y: C = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: A = None
        self.x: H = None
        self.r: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: D = None
        self.r: E = None
        self.x: C = None
        self.s: H = None
        self.y: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: G = None
        self.q: C = None
        self.p: D = None
        self.y: C = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: A = None
        self.x: H = None
        self.r: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: D = None
        self.r: E = None
        self.x: C = None
        self.s: H = None
        self.y: E = None
        self.txt = txt

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

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

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