class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: C = None
        self.t: C = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: B = None
        self.o: E = None
        self.v: B = None
        self.y: F = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: A = None
        self.y: F = None
        self.v: G = None
        self.o: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: D = None
        self.s: C = None
        self.w: D = None
        self.x: A = None
        self.t: G = None
        self.o: D = None
        self.txt = txt

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

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

m = A("m")
f = B("f")
c = C("c")
d = D("d")
j = E("j")
n = F("n")
h = G("h")
k = B("k")
l = D("l")
b = G("b")

m.s = c
m.w = c
m.t = c
m.y = d
f.u = j
f.z = l
c.s = n
c.y = n
c.w = f
c.v = f
c.x = f
c.o = j
d.z = k
d.p = m
d.y = n
d.v = b
d.o = l
j.y = c
j.s = c
j.v = l
j.o = l
j.w = d
j.x = m
j.t = h
n.s = j
h.x = b
h.w = b
h.t = j
h.v = n
h.y = m
h.u = f
h.z = d
k.u = j
k.z = d
l.z = k
l.p = m
l.y = n
l.v = h
l.o = d
b.x = h
b.w = h
b.t = j
b.v = n
b.y = m
b.u = f
b.z = l
assert j.w.p.y.z.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: C = None
        self.t: C = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: B = None
        self.o: E = None
        self.v: B = None
        self.y: F = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: A = None
        self.y: F = None
        self.v: G = None
        self.o: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: D = None
        self.s: C = None
        self.w: D = None
        self.x: A = None
        self.t: G = None
        self.o: D = None
        self.txt = txt

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

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

m = A("m")
f = B("f")
c = C("c")
d = D("d")
j = E("j")
n = F("n")
h = G("h")
k = B("k")
l = D("l")
b = G("b")

m.s = c
m.w = c
m.t = c
m.y = d
f.u = j
f.z = l
c.s = n
c.y = n
c.w = f
c.v = f
c.x = f
c.o = j
d.z = k
d.p = m
d.y = n
d.v = b
d.o = l
j.y = c
j.s = c
j.v = l
j.o = l
j.w = d
j.x = m
j.t = h
n.s = j
h.x = b
h.w = b
h.t = j
h.v = n
h.y = m
h.u = f
h.z = d
k.u = j
k.z = d
l.z = k
l.p = m
l.y = n
l.v = h
l.o = d
b.x = h
b.w = h
b.t = j
b.v = n
b.y = m
b.u = f
b.z = l
assert j.w.p.y.z.z.p.txt == "m"