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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: I = None
        self.p: F = None
        self.z: F = None
        self.x: E = None
        self.s: F = None
        self.w: H = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: I = None
        self.p: F = None
        self.z: F = None
        self.x: E = None
        self.s: F = None
        self.w: H = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: F = None
        self.txt = txt

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

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

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