class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: G = None
        self.z: A = None
        self.x: C = None
        self.q: E = None
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: E = None
        self.q: B = None
        self.p: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: D = None
        self.s: F = None
        self.v: D = None
        self.p: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: G = None
        self.z: A = None
        self.x: C = None
        self.q: E = None
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: E = None
        self.q: B = None
        self.p: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: D = None
        self.s: F = None
        self.v: D = None
        self.p: A = None
        self.u: B = None
        self.txt = txt

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

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