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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: G = None
        self.u: E = None
        self.p: F = None
        self.v: B = None
        self.o: D = None
        self.r: B = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: A = None
        self.w: D = None
        self.s: G = None
        self.t: A = None
        self.v: D = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: G = None
        self.txt = txt

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

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

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

a = A("a")
b = B("b")
e = C("e")
d = D("d")
c = E("c")
k = F("k")
l = G("l")
f = H("f")
h = D("h")

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: G = None
        self.u: E = None
        self.p: F = None
        self.v: B = None
        self.o: D = None
        self.r: B = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: A = None
        self.w: D = None
        self.s: G = None
        self.t: A = None
        self.v: D = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: G = None
        self.txt = txt

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

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

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

a = A("a")
b = B("b")
e = C("e")
d = D("d")
c = E("c")
k = F("k")
l = G("l")
f = H("f")
h = D("h")

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