class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: C = None
        self.p: B = None
        self.z: D = None
        self.x: C = None
        self.s: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: A = None
        self.q: F = None
        self.txt = txt

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

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

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

f = A("f")
m = B("m")
e = C("e")
c = D("c")
g = E("g")
a = F("a")
i = D("i")
l = B("l")

f.s = a
f.u = e
f.p = e
m.o = a
m.t = e
m.x = e
m.p = l
m.s = l
m.z = i
e.x = g
e.r = f
e.q = a
c.u = m
c.o = l
c.x = a
g.z = e
g.x = l
g.v = l
a.p = f
a.u = f
a.w = f
i.u = l
i.o = m
i.x = a
l.o = a
l.t = e
l.x = e
l.p = m
l.s = m
l.z = c
assert g.x.o.w.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: C = None
        self.p: B = None
        self.z: D = None
        self.x: C = None
        self.s: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: A = None
        self.q: F = None
        self.txt = txt

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

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

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

f = A("f")
m = B("m")
e = C("e")
c = D("c")
g = E("g")
a = F("a")
i = D("i")
l = B("l")

f.s = a
f.u = e
f.p = e
m.o = a
m.t = e
m.x = e
m.p = l
m.s = l
m.z = i
e.x = g
e.r = f
e.q = a
c.u = m
c.o = l
c.x = a
g.z = e
g.x = l
g.v = l
a.p = f
a.u = f
a.w = f
i.u = l
i.o = m
i.x = a
l.o = a
l.t = e
l.x = e
l.p = m
l.s = m
l.z = c
assert g.x.o.w.s.p.txt == "f"