class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: D = None
        self.o: G = None
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: D = None
        self.o: E = None
        self.y: J = None
        self.r: B = None
        self.v: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: H = None
        self.v: I = None
        self.p: H = None
        self.r: C = None
        self.t: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: H = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: J = None
        self.v: E = None
        self.z: F = None
        self.u: F = None
        self.w: C = None
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: J = None
        self.p: A = None
        self.q: D = None
        self.w: G = None
        self.z: H = None
        self.t: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: D = None
        self.o: E = None
        self.y: J = None
        self.r: B = None
        self.v: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: H = None
        self.v: I = None
        self.p: H = None
        self.r: C = None
        self.t: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: H = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: J = None
        self.v: E = None
        self.z: F = None
        self.u: F = None
        self.w: C = None
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: J = None
        self.p: A = None
        self.q: D = None
        self.w: G = None
        self.z: H = None
        self.t: E = None
        self.txt = txt

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

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

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