class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: G = None
        self.t: H = None
        self.s: J = None
        self.z: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: B = None
        self.r: C = None
        self.o: C = None
        self.y: F = None
        self.p: F = None
        self.q: I = None
        self.v: J = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: B = None
        self.r: C = None
        self.o: C = None
        self.y: F = None
        self.p: F = None
        self.q: I = None
        self.v: J = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: G = None
        self.txt = txt

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

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