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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: B = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: B = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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