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

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

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

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

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

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

i = A("i")
l = B("l")
m = C("m")
k = D("k")
j = E("j")
h = F("h")

i.y = h
i.w = h
i.s = h
i.x = k
i.z = m
l.z = j
l.o = k
m.s = i
k.q = h
k.x = l
j.x = l
h.v = l
h.x = j
assert j.x.o.q.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: F = None
        self.x: D = None
        self.z: C = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

i = A("i")
l = B("l")
m = C("m")
k = D("k")
j = E("j")
h = F("h")

i.y = h
i.w = h
i.s = h
i.x = k
i.z = m
l.z = j
l.o = k
m.s = i
k.q = h
k.x = l
j.x = l
h.v = l
h.x = j
assert j.x.o.q.x.x.txt == "l"