class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: J = None
        self.w: G = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: E = None
        self.v: G = None
        self.r: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: G = None
        self.w: F = None
        self.q: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: J = None
        self.q: C = None
        self.y: E = None
        self.o: G = None
        self.u: D = None
        self.x: G = None
        self.r: J = None
        self.v: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: E = None
        self.v: G = None
        self.r: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: G = None
        self.w: F = None
        self.q: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: J = None
        self.q: C = None
        self.y: E = None
        self.o: G = None
        self.u: D = None
        self.x: G = None
        self.r: J = None
        self.v: A = None
        self.txt = txt

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

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

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