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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: A = None
        self.q: H = None
        self.x: G = None
        self.w: D = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: C = None
        self.q: H = None
        self.s: H = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: C = None
        self.x: G = None
        self.w: B = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.y: G = None
        self.o: G = None
        self.s: B = None
        self.v: E = None
        self.r: C = None
        self.x: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: D = None
        self.z: A = None
        self.o: A = None
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: D = None
        self.q: E = None
        self.r: B = None
        self.w: C = None
        self.z: A = None
        self.u: H = None
        self.s: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: A = None
        self.q: H = None
        self.x: G = None
        self.w: D = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: C = None
        self.q: H = None
        self.s: H = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: C = None
        self.x: G = None
        self.w: B = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.y: G = None
        self.o: G = None
        self.s: B = None
        self.v: E = None
        self.r: C = None
        self.x: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: D = None
        self.z: A = None
        self.o: A = None
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: D = None
        self.q: E = None
        self.r: B = None
        self.w: C = None
        self.z: A = None
        self.u: H = None
        self.s: C = None
        self.txt = txt

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

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