class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.o: G = None
        self.x: C = None
        self.p: E = None
        self.z: G = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.s: H = None
        self.u: E = None
        self.z: D = None
        self.t: I = None
        self.y: B = None
        self.w: H = None
        self.o: I = None
        self.v: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: B = None
        self.v: A = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.t: E = None
        self.y: J = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.s: H = None
        self.u: E = None
        self.z: D = None
        self.t: I = None
        self.y: B = None
        self.w: H = None
        self.o: I = None
        self.v: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: B = None
        self.v: A = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.t: E = None
        self.y: J = None
        self.txt = txt

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

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

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