class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: B = None
        self.r: E = None
        self.w: G = None
        self.s: B = None
        self.u: B = None
        self.z: G = None
        self.q: F = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: E = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.y: E = None
        self.o: F = None
        self.r: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: D = None
        self.y: H = None
        self.t: I = None
        self.s: A = None
        self.w: I = None
        self.o: A = None
        self.v: I = None
        self.r: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: C = None
        self.o: J = None
        self.u: C = None
        self.s: G = None
        self.v: G = None
        self.t: J = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: E = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.y: E = None
        self.o: F = None
        self.r: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: D = None
        self.y: H = None
        self.t: I = None
        self.s: A = None
        self.w: I = None
        self.o: A = None
        self.v: I = None
        self.r: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: C = None
        self.o: J = None
        self.u: C = None
        self.s: G = None
        self.v: G = None
        self.t: J = None
        self.txt = txt

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

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

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