class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: B = None
        self.z: F = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: E = None
        self.t: E = None
        self.r: F = None
        self.z: A = None
        self.p: D = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: A = None
        self.z: H = None
        self.t: I = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: H = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: E = None
        self.t: E = None
        self.r: F = None
        self.z: A = None
        self.p: D = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: A = None
        self.z: H = None
        self.t: I = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: H = None
        self.t: C = None
        self.txt = txt

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

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

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

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