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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: F = None
        self.v: B = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: B = None
        self.z: G = None
        self.t: C = None
        self.x: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: H = None
        self.z: B = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: D = None
        self.x: B = None
        self.s: E = None
        self.txt = txt

m = A("m")
f = B("f")
e = C("e")
i = D("i")
h = E("h")
g = F("g")
c = G("c")
k = H("k")
n = F("n")

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: F = None
        self.v: B = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: B = None
        self.z: G = None
        self.t: C = None
        self.x: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: H = None
        self.z: B = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: D = None
        self.x: B = None
        self.s: E = None
        self.txt = txt

m = A("m")
f = B("f")
e = C("e")
i = D("i")
h = E("h")
g = F("g")
c = G("c")
k = H("k")
n = F("n")

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