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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: C = None
        self.o: E = None
        self.s: C = None
        self.z: E = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: B = None
        self.o: D = None
        self.q: G = None
        self.w: D = None
        self.p: G = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: B = None
        self.txt = txt

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

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

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

f = A("f")
g = B("g")
e = C("e")
b = D("b")
j = E("j")
m = F("m")
c = G("c")
a = E("a")
n = A("n")

f.y = b
g.v = b
g.x = b
g.q = e
g.s = e
g.o = a
g.z = a
e.v = g
e.x = g
e.o = b
e.w = b
e.q = c
e.p = c
e.u = m
b.s = e
b.z = g
j.q = f
j.p = a
j.v = g
m.u = e
m.p = c
m.w = b
m.s = n
m.q = a
m.o = a
c.w = n
c.q = f
c.y = g
a.q = n
a.p = j
a.v = g
n.y = b
assert g.o.v.q.o.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: C = None
        self.o: E = None
        self.s: C = None
        self.z: E = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: B = None
        self.o: D = None
        self.q: G = None
        self.w: D = None
        self.p: G = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: B = None
        self.txt = txt

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

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

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

f = A("f")
g = B("g")
e = C("e")
b = D("b")
j = E("j")
m = F("m")
c = G("c")
a = E("a")
n = A("n")

f.y = b
g.v = b
g.x = b
g.q = e
g.s = e
g.o = a
g.z = a
e.v = g
e.x = g
e.o = b
e.w = b
e.q = c
e.p = c
e.u = m
b.s = e
b.z = g
j.q = f
j.p = a
j.v = g
m.u = e
m.p = c
m.w = b
m.s = n
m.q = a
m.o = a
c.w = n
c.q = f
c.y = g
a.q = n
a.p = j
a.v = g
n.y = b
assert g.o.v.q.o.s.v.txt == "g"