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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: E = None
        self.t: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: F = None
        self.o: C = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: E = None
        self.t: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: F = None
        self.o: C = None
        self.w: B = None
        self.txt = txt

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

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

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