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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: E = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: F = None
        self.o: G = None
        self.q: H = None
        self.x: C = None
        self.t: C = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: E = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: F = None
        self.o: G = None
        self.q: H = None
        self.x: C = None
        self.t: C = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

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