class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: I = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: F = None
        self.u: I = None
        self.o: G = None
        self.q: E = None
        self.t: E = None
        self.s: G = None
        self.z: E = None
        self.w: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: D = None
        self.t: A = None
        self.txt = txt

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

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

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

c = A("c")
k = B("k")
d = C("d")
f = D("f")
b = E("b")
n = F("n")
g = G("g")
i = H("i")
a = I("a")
h = E("h")

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: F = None
        self.u: I = None
        self.o: G = None
        self.q: E = None
        self.t: E = None
        self.s: G = None
        self.z: E = None
        self.w: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: D = None
        self.t: A = None
        self.txt = txt

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

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

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

c = A("c")
k = B("k")
d = C("d")
f = D("f")
b = E("b")
n = F("n")
g = G("g")
i = H("i")
a = I("a")
h = E("h")

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