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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: B = None
        self.y: D = None
        self.r: G = None
        self.u: B = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: C = None
        self.s: C = None
        self.w: B = None
        self.r: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: H = None
        self.y: B = None
        self.u: B = None
        self.w: H = None
        self.x: D = None
        self.r: H = None
        self.s: B = None
        self.txt = txt

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

j.t = l
j.o = b
b.z = j
b.u = f
h.t = l
h.s = i
h.q = i
h.z = j
h.v = j
h.x = j
h.w = d
d.t = n
d.v = k
d.u = b
d.w = j
d.x = f
d.q = f
d.s = i
n.o = i
n.v = b
n.u = b
n.s = b
n.y = d
n.r = k
l.x = f
l.w = f
k.p = f
k.v = h
k.s = h
k.w = b
k.r = i
f.r = d
i.q = j
i.t = f
i.w = f
i.r = f
i.y = b
i.u = b
i.s = b
i.x = d
assert l.x.r.w.t.w.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: B = None
        self.y: D = None
        self.r: G = None
        self.u: B = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: C = None
        self.s: C = None
        self.w: B = None
        self.r: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: H = None
        self.y: B = None
        self.u: B = None
        self.w: H = None
        self.x: D = None
        self.r: H = None
        self.s: B = None
        self.txt = txt

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

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