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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: H = None
        self.z: F = None
        self.s: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

j = A("j")
h = B("h")
g = C("g")
m = D("m")
a = E("a")
i = F("i")
f = G("f")
k = H("k")

j.v = h
j.x = a
h.r = i
h.z = i
h.x = k
h.s = g
g.y = i
m.z = i
m.q = f
a.s = h
a.o = k
a.x = f
a.r = f
a.w = j
a.p = j
a.z = i
i.y = j
f.v = j
f.t = a
f.s = h
f.o = i
f.q = g
f.w = k
k.x = m
k.y = j
k.t = a
assert g.y.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: H = None
        self.z: F = None
        self.s: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

j = A("j")
h = B("h")
g = C("g")
m = D("m")
a = E("a")
i = F("i")
f = G("f")
k = H("k")

j.v = h
j.x = a
h.r = i
h.z = i
h.x = k
h.s = g
g.y = i
m.z = i
m.q = f
a.s = h
a.o = k
a.x = f
a.r = f
a.w = j
a.p = j
a.z = i
i.y = j
f.v = j
f.t = a
f.s = h
f.o = i
f.q = g
f.w = k
k.x = m
k.y = j
k.t = a
assert g.y.y.v.txt == "h"