class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: H = None
        self.r: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: F = None
        self.r: C = None
        self.u: A = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: I = None
        self.w: F = None
        self.v: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: J = None
        self.t: B = None
        self.z: F = None
        self.p: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: F = None
        self.v: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: D = None
        self.v: D = None
        self.u: C = None
        self.t: F = None
        self.z: E = None
        self.x: E = None
        self.txt = txt

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

m.w = h
m.p = h
m.r = i
i.r = e
i.q = j
f.w = m
f.t = m
f.z = l
f.v = c
f.r = c
j.s = l
j.t = l
j.r = f
j.u = m
j.o = m
c.o = h
c.z = a
c.w = l
c.v = l
l.r = j
l.u = j
l.q = h
l.t = f
l.o = c
l.z = c
l.v = i
l.x = m
e.w = c
e.u = f
e.x = l
h.q = d
h.t = i
h.z = l
h.p = c
a.z = e
a.s = l
a.v = m
d.p = l
d.t = l
d.w = j
d.v = j
d.u = f
d.z = c
d.x = c
assert d.v.o.w.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: H = None
        self.r: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: F = None
        self.r: C = None
        self.u: A = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: I = None
        self.w: F = None
        self.v: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: J = None
        self.t: B = None
        self.z: F = None
        self.p: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: F = None
        self.v: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: D = None
        self.v: D = None
        self.u: C = None
        self.t: F = None
        self.z: E = None
        self.x: E = None
        self.txt = txt

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

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