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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: G = None
        self.z: E = None
        self.o: E = None
        self.x: F = None
        self.y: G = None
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: C = None
        self.t: C = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: B = None
        self.r: A = None
        self.s: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: G = None
        self.z: E = None
        self.o: E = None
        self.x: F = None
        self.y: G = None
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: C = None
        self.t: C = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: B = None
        self.r: A = None
        self.s: D = None
        self.txt = txt

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

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