class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: C = None
        self.v: B = None
        self.w: C = None
        self.z: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: H = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: H = None
        self.y: G = None
        self.v: D = None
        self.p: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

k = A("k")
m = B("m")
f = C("f")
g = D("g")
h = E("h")
b = F("b")
c = G("c")
e = H("e")

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: H = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: H = None
        self.y: G = None
        self.v: D = None
        self.p: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

k = A("k")
m = B("m")
f = C("f")
g = D("g")
h = E("h")
b = F("b")
c = G("c")
e = H("e")

k.x = f
k.o = f
k.w = f
k.v = m
k.z = c
m.p = e
m.y = e
m.v = c
m.x = k
m.o = h
m.t = g
f.v = b
f.x = e
f.t = c
g.r = h
g.z = k
h.w = k
h.p = k
h.u = e
h.y = c
h.v = g
b.o = h
b.q = m
b.u = m
b.r = c
b.z = c
c.p = g
e.y = f
e.w = f
e.p = f
e.t = c
e.v = m
assert k.x.t.p.r.w.z.p.z.txt == "k"