class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: B = None
        self.s: F = None
        self.t: F = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: C = None
        self.z: F = None
        self.o: F = None
        self.p: D = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: B = None
        self.s: F = None
        self.t: F = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: C = None
        self.z: F = None
        self.o: F = None
        self.p: D = None
        self.r: G = None
        self.txt = txt

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

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

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

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