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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.p: C = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.p: C = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

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

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