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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: C = None
        self.txt = txt

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

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