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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

b.z = g
b.s = m
b.x = k
h.o = c
c.z = l
m.o = h
f.w = c
f.x = c
f.o = b
f.p = g
f.y = l
f.v = h
g.x = m
g.y = m
g.r = k
n.z = l
k.w = n
k.o = l
k.p = g
k.y = b
k.v = h
k.x = c
l.z = g
l.s = m
l.x = f
assert f.x.z.s.txt == "m"