class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: E = None
        self.o: F = None
        self.y: G = None
        self.z: B = None
        self.p: B = None
        self.q: H = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: H = None
        self.t: B = None
        self.v: H = None
        self.p: D = None
        self.o: B = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

n = A("n")
k = B("k")
f = C("f")
a = D("a")
g = E("g")
h = F("h")
j = G("j")
d = H("d")

n.r = h
n.o = h
n.w = g
n.y = j
n.z = k
n.p = k
n.q = d
n.x = f
k.z = a
k.v = n
k.x = n
k.s = n
k.r = h
k.q = h
k.y = f
k.t = g
f.t = n
f.s = n
f.y = g
f.v = h
f.u = h
f.z = a
f.w = j
f.q = j
a.w = f
a.v = h
a.r = h
a.t = d
a.z = n
a.q = j
a.y = g
g.t = n
g.y = n
g.z = j
g.v = d
g.r = d
g.p = k
g.x = h
g.q = a
h.t = j
h.u = f
h.r = f
h.x = k
h.o = a
j.y = h
j.x = d
j.v = d
j.t = k
j.o = k
j.p = a
j.r = a
d.u = j
assert j.x.u.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: E = None
        self.o: F = None
        self.y: G = None
        self.z: B = None
        self.p: B = None
        self.q: H = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: H = None
        self.t: B = None
        self.v: H = None
        self.p: D = None
        self.o: B = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

n = A("n")
k = B("k")
f = C("f")
a = D("a")
g = E("g")
h = F("h")
j = G("j")
d = H("d")

n.r = h
n.o = h
n.w = g
n.y = j
n.z = k
n.p = k
n.q = d
n.x = f
k.z = a
k.v = n
k.x = n
k.s = n
k.r = h
k.q = h
k.y = f
k.t = g
f.t = n
f.s = n
f.y = g
f.v = h
f.u = h
f.z = a
f.w = j
f.q = j
a.w = f
a.v = h
a.r = h
a.t = d
a.z = n
a.q = j
a.y = g
g.t = n
g.y = n
g.z = j
g.v = d
g.r = d
g.p = k
g.x = h
g.q = a
h.t = j
h.u = f
h.r = f
h.x = k
h.o = a
j.y = h
j.x = d
j.v = d
j.t = k
j.o = k
j.p = a
j.r = a
d.u = j
assert j.x.u.r.q.txt == "j"