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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: E = None
        self.p: E = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: B = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: F = None
        self.p: A = None
        self.u: B = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: F = None
        self.o: F = None
        self.t: F = None
        self.z: D = None
        self.s: F = None
        self.txt = txt

a = A("a")
n = B("n")
m = C("m")
j = D("j")
i = E("i")
f = F("f")
h = G("h")
c = D("c")

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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: E = None
        self.p: E = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: B = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: F = None
        self.p: A = None
        self.u: B = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: F = None
        self.o: F = None
        self.t: F = None
        self.z: D = None
        self.s: F = None
        self.txt = txt

a = A("a")
n = B("n")
m = C("m")
j = D("j")
i = E("i")
f = F("f")
h = G("h")
c = D("c")

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