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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: C = None
        self.r: F = None
        self.u: E = None
        self.t: C = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: C = None
        self.r: F = None
        self.u: E = None
        self.t: C = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: B = None
        self.txt = txt

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

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

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