class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: B = None
        self.p: C = None
        self.t: A = None
        self.q: F = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: C = None
        self.s: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: C = None
        self.s: C = None
        self.txt = txt

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

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