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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: C = None
        self.z: F = None
        self.p: C = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: B = None
        self.q: B = None
        self.w: A = None
        self.txt = txt

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

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

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

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

e = A("e")
b = B("b")
g = C("g")
h = D("h")
f = E("f")
d = F("d")
n = G("n")
l = E("l")
i = A("i")

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: C = None
        self.z: F = None
        self.p: C = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: B = None
        self.q: B = None
        self.w: A = None
        self.txt = txt

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

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

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

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

e = A("e")
b = B("b")
g = C("g")
h = D("h")
f = E("f")
d = F("d")
n = G("n")
l = E("l")
i = A("i")

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