class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: I = None
        self.t: F = None
        self.p: I = None
        self.q: G = None
        self.s: G = None
        self.z: B = None
        self.v: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: E = None
        self.v: H = None
        self.y: A = None
        self.w: G = None
        self.s: H = None
        self.q: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: C = None
        self.s: H = None
        self.o: C = None
        self.t: H = None
        self.p: B = None
        self.x: F = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: C = None
        self.txt = txt

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

n = A("n")
f = B("f")
m = C("m")
h = D("h")
g = E("g")
l = F("l")
i = G("i")
b = H("b")
e = I("e")
c = E("c")

n.x = h
n.y = e
n.p = e
n.t = l
n.q = i
n.s = i
n.z = f
n.v = b
f.t = n
m.v = c
m.q = i
m.r = e
h.t = f
h.q = f
h.x = c
h.v = b
h.s = b
h.y = n
h.w = i
g.v = f
g.s = i
l.x = i
l.r = b
l.u = b
l.s = b
l.y = b
l.v = n
l.o = c
l.z = e
l.p = f
i.v = h
i.r = m
i.o = m
i.s = b
i.t = b
i.p = f
i.u = f
i.x = l
b.x = l
b.y = m
e.z = i
c.v = f
c.s = i
assert f.t.z.t.p.z.r.v.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: I = None
        self.t: F = None
        self.p: I = None
        self.q: G = None
        self.s: G = None
        self.z: B = None
        self.v: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: E = None
        self.v: H = None
        self.y: A = None
        self.w: G = None
        self.s: H = None
        self.q: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: C = None
        self.s: H = None
        self.o: C = None
        self.t: H = None
        self.p: B = None
        self.x: F = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: C = None
        self.txt = txt

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

n = A("n")
f = B("f")
m = C("m")
h = D("h")
g = E("g")
l = F("l")
i = G("i")
b = H("b")
e = I("e")
c = E("c")

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