class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: E = None
        self.t: B = None
        self.o: H = None
        self.r: D = None
        self.w: G = None
        self.p: F = None
        self.x: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: E = None
        self.t: B = None
        self.o: H = None
        self.r: D = None
        self.w: G = None
        self.p: F = None
        self.x: D = None
        self.v: D = None
        self.txt = txt

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

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