class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: E = None
        self.x: C = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: H = None
        self.u: F = None
        self.o: I = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: E = None
        self.p: J = None
        self.x: F = None
        self.t: H = None
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.x: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: C = None
        self.q: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.r: I = None
        self.q: G = None
        self.u: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: A = None
        self.w: D = None
        self.v: C = None
        self.t: F = None
        self.q: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: H = None
        self.u: F = None
        self.o: I = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: E = None
        self.p: J = None
        self.x: F = None
        self.t: H = None
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.x: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: C = None
        self.q: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.r: I = None
        self.q: G = None
        self.u: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: A = None
        self.w: D = None
        self.v: C = None
        self.t: F = None
        self.q: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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