class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: H = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: H = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: E = None
        self.o: F = None
        self.txt = txt

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

b.p = h
b.o = h
b.x = k
a.w = n
a.t = n
a.r = h
e.x = a
e.s = a
e.r = a
e.p = a
e.v = g
e.t = b
e.z = n
e.y = n
g.y = c
g.v = h
c.s = h
c.x = n
c.q = n
c.r = k
c.w = k
c.y = e
c.z = a
k.v = a
k.z = a
k.t = n
k.w = e
k.r = h
k.p = b
k.s = b
k.x = c
n.s = e
n.p = e
n.z = g
h.z = n
h.w = c
h.o = k
assert k.w.t.o.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: H = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: H = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: E = None
        self.o: F = None
        self.txt = txt

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

b.p = h
b.o = h
b.x = k
a.w = n
a.t = n
a.r = h
e.x = a
e.s = a
e.r = a
e.p = a
e.v = g
e.t = b
e.z = n
e.y = n
g.y = c
g.v = h
c.s = h
c.x = n
c.q = n
c.r = k
c.w = k
c.y = e
c.z = a
k.v = a
k.z = a
k.t = n
k.w = e
k.r = h
k.p = b
k.s = b
k.x = c
n.s = e
n.p = e
n.z = g
h.z = n
h.w = c
h.o = k
assert k.w.t.o.o.v.txt == "a"