class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: F = None
        self.r: D = None
        self.o: F = None
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: F = None
        self.y: F = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.o: A = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: E = None
        self.txt = txt

d = A("d")
l = B("l")
i = C("i")
h = D("h")
n = E("n")
g = F("g")
k = F("k")
m = E("m")

d.z = i
d.q = g
d.r = h
d.o = k
d.s = l
l.u = d
i.r = l
i.z = g
i.y = g
i.q = k
h.z = d
h.o = d
h.v = l
h.x = i
n.q = k
n.r = h
n.w = d
n.o = d
g.w = i
g.y = m
k.w = i
k.y = m
m.q = k
m.r = h
m.w = d
m.o = d
assert k.w.r.u.q.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: F = None
        self.r: D = None
        self.o: F = None
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: F = None
        self.y: F = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.o: A = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: E = None
        self.txt = txt

d = A("d")
l = B("l")
i = C("i")
h = D("h")
n = E("n")
g = F("g")
k = F("k")
m = E("m")

d.z = i
d.q = g
d.r = h
d.o = k
d.s = l
l.u = d
i.r = l
i.z = g
i.y = g
i.q = k
h.z = d
h.o = d
h.v = l
h.x = i
n.q = k
n.r = h
n.w = d
n.o = d
g.w = i
g.y = m
k.w = i
k.y = m
m.q = k
m.r = h
m.w = d
m.o = d
assert k.w.r.u.q.y.o.txt == "d"