class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: C = None
        self.q: H = None
        self.z: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: E = None
        self.z: I = None
        self.p: B = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: C = None
        self.r: H = None
        self.t: H = None
        self.z: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: E = None
        self.z: I = None
        self.p: B = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: C = None
        self.r: H = None
        self.t: H = None
        self.z: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

g.r = e
g.s = b
g.q = i
g.z = a
d.r = n
d.s = b
d.v = b
d.p = m
b.q = i
b.u = g
n.x = f
n.r = a
n.z = j
n.p = d
n.s = d
a.v = j
f.v = j
f.q = b
f.r = i
f.t = e
f.z = n
m.s = a
m.t = d
m.z = b
i.p = a
i.o = m
j.v = n
e.p = a
e.o = m
assert d.p.s.v.v.x.r.o.s.v.v.txt == "n"