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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: C = None
        self.v: C = None
        self.s: H = None
        self.q: C = None
        self.t: H = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: G = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: D = None
        self.q: F = None
        self.z: C = None
        self.t: C = None
        self.u: F = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: C = None
        self.v: C = None
        self.s: H = None
        self.q: C = None
        self.t: H = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: G = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: D = None
        self.q: F = None
        self.z: C = None
        self.t: C = None
        self.u: F = None
        self.y: B = None
        self.txt = txt

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

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