class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: G = None
        self.q: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: F = None
        self.s: A = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: J = None
        self.x: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: I = None
        self.u: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: F = None
        self.w: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

n = A("n")
d = B("d")
c = C("c")
h = D("h")
b = E("b")
i = F("i")
a = G("a")
j = H("j")
l = I("l")
g = J("g")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: F = None
        self.s: A = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: J = None
        self.x: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: I = None
        self.u: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: F = None
        self.w: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

n = A("n")
d = B("d")
c = C("c")
h = D("h")
b = E("b")
i = F("i")
a = G("a")
j = H("j")
l = I("l")
g = J("g")

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