class A:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: A = None
        self.r: H = None
        self.t: A = None
        self.x: H = None
        self.y: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: F = None
        self.x: I = None
        self.o: A = None
        self.u: A = None
        self.v: H = None
        self.t: C = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: H = None
        self.p: I = None
        self.u: A = None
        self.y: I = None
        self.x: H = None
        self.w: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: A = None
        self.x: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: A = None
        self.r: H = None
        self.t: A = None
        self.x: H = None
        self.y: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: F = None
        self.x: I = None
        self.o: A = None
        self.u: A = None
        self.v: H = None
        self.t: C = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: H = None
        self.p: I = None
        self.u: A = None
        self.y: I = None
        self.x: H = None
        self.w: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: A = None
        self.x: B = None
        self.txt = txt

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

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