class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: D = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: A = None
        self.w: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: F = None
        self.r: E = None
        self.q: D = None
        self.t: D = None
        self.v: F = None
        self.u: F = None
        self.txt = txt

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

c.v = k
i.w = e
i.t = f
i.v = d
i.p = a
k.s = a
k.u = d
k.t = i
k.v = i
d.z = i
d.o = c
d.w = a
e.o = k
e.u = i
e.y = i
j.x = k
f.v = a
f.z = i
f.q = e
f.w = e
f.u = d
f.t = d
a.x = i
a.p = j
a.v = j
a.u = j
a.r = e
a.q = d
a.t = d
assert c.v.u.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: D = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: A = None
        self.w: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: F = None
        self.r: E = None
        self.q: D = None
        self.t: D = None
        self.v: F = None
        self.u: F = None
        self.txt = txt

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

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