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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: F = None
        self.s: A = None
        self.p: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: F = None
        self.q: D = None
        self.r: C = None
        self.txt = txt

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

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

h = A("h")
j = B("j")
e = C("e")
i = D("i")
a = E("a")
n = F("n")
g = G("g")
b = C("b")
m = F("m")

h.v = a
j.z = n
e.o = g
e.z = n
e.s = h
e.p = b
i.t = g
a.t = j
a.u = m
a.q = i
a.r = e
n.o = g
n.v = g
n.y = e
n.s = a
g.t = n
b.o = g
b.z = n
b.s = h
b.p = e
m.o = g
m.v = g
m.y = b
m.s = a
assert e.p.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: F = None
        self.s: A = None
        self.p: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: F = None
        self.q: D = None
        self.r: C = None
        self.txt = txt

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

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

h = A("h")
j = B("j")
e = C("e")
i = D("i")
a = E("a")
n = F("n")
g = G("g")
b = C("b")
m = F("m")

h.v = a
j.z = n
e.o = g
e.z = n
e.s = h
e.p = b
i.t = g
a.t = j
a.u = m
a.q = i
a.r = e
n.o = g
n.v = g
n.y = e
n.s = a
g.t = n
b.o = g
b.z = n
b.s = h
b.p = e
m.o = g
m.v = g
m.y = b
m.s = a
assert e.p.s.v.txt == "a"