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

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

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

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: H = None
        self.u: B = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: D = None
        self.x: C = None
        self.w: D = None
        self.q: F = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: D = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: H = None
        self.u: B = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: D = None
        self.x: C = None
        self.w: D = None
        self.q: F = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: D = None
        self.t: D = None
        self.txt = txt

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

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

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

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