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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: C = None
        self.t: D = None
        self.y: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: C = None
        self.t: D = None
        self.y: B = None
        self.txt = txt

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

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

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

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