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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: D = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: D = None
        self.x: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: B = None
        self.w: A = None
        self.u: A = None
        self.s: D = None
        self.txt = txt

b = A("b")
i = B("i")
g = C("g")
a = D("a")
m = E("m")
j = F("j")
n = G("n")
f = C("f")
h = D("h")
d = E("d")

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: D = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: D = None
        self.x: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: B = None
        self.w: A = None
        self.u: A = None
        self.s: D = None
        self.txt = txt

b = A("b")
i = B("i")
g = C("g")
a = D("a")
m = E("m")
j = F("j")
n = G("n")
f = C("f")
h = D("h")
d = E("d")

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