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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: B = None
        self.u: B = None
        self.q: C = None
        self.o: E = None
        self.y: C = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: A = None
        self.v: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: B = None
        self.u: B = None
        self.q: C = None
        self.o: E = None
        self.y: C = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: A = None
        self.v: D = None
        self.txt = txt

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

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