class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: B = None
        self.o: D = None
        self.s: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: D = None
        self.x: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: E = None
        self.u: D = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: D = None
        self.x: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: E = None
        self.u: D = None
        self.x: D = None
        self.txt = txt

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

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