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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: D = None
        self.u: A = None
        self.r: C = None
        self.y: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: E = None
        self.x: F = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: E = None
        self.x: D = None
        self.t: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: D = None
        self.u: A = None
        self.r: C = None
        self.y: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: E = None
        self.x: F = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: E = None
        self.x: D = None
        self.t: D = None
        self.txt = txt

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

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